package com.example.evanproject.mapper;

import com.example.evanproject.domain.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author hanxiaoqi
* @description 针对表【course】的数据库操作Mapper
* @createDate 2024-03-09 21:52:12
* @Entity generator.domain.Course
*/
@Mapper
public interface CourseMapper extends BaseMapper<Course> {
    @Select("select * from course")
    List<Course> selecttest();

    List<Course> selectbyids(String[] ids);

    @Select("select * from course where course_id=#{cId}")
    Course selectListById(Integer cId);

    //查询课程按照数组查询 带有返回的老师信息

    List<Course> selectbycoueseid(String[] ids);


    @Select("select * from course where t_id=#{tid}")
    List<Course> selectByTid(Integer tid);

    @Insert("insert into course (course_name,t_id,course_note,course_starttime,course_endtime,course_tyid,course_money,course_img) values( #{courseName},#{tId},#{courseNote},#{courseStarttime},#{courseEndtime},#{courseTyid},#{courseMoney},#{courseImg})")

    Integer addcourselist(String courseName, Integer tId, String courseNote, String courseStarttime, String courseEndtime, Integer courseTyid, Integer courseMoney, String courseImg);


    @Delete("delete  from course where course_id=#{courseId}")
    Integer delectcoursebyid(Integer courseId);

    List<Course> couserBarnk();
}




